﻿namespace _2_NovaAdmin.Application.Services.ChatGroup;

public class ChatGroupService : IDynamicController
{

    private readonly IRepository<_3_NovaAdmin.Domain.Aggregates.ChatGroup> _chatGroupRepository;
    //private readonly IRepository<GroupMember> _aaa;
    private readonly IRepository<_3_NovaAdmin.Domain.Entities.User> _userRepository;
    public ChatGroupService(IRepository<_3_NovaAdmin.Domain.Aggregates.ChatGroup> chatGroupRepository, IRepository<_3_NovaAdmin.Domain.Entities.User> userRepository)
    {
        _chatGroupRepository = chatGroupRepository;
        _userRepository = userRepository;
    }

    public async Task<ApiResult<List<_3_NovaAdmin.Domain.Aggregates.ChatGroup>>> QueryChatGroup([FromBody] DtoUserRequest request)
    {
        List<_3_NovaAdmin.Domain.Aggregates.ChatGroup> list = await _chatGroupRepository.QueryTableList(m => true);
        List<_3_NovaAdmin.Domain.Entities.User> users = await _userRepository.QueryTableList(m => true);

        return ApiResult<List<_3_NovaAdmin.Domain.Aggregates.ChatGroup>>.Ok(list);

    }
}
